package com.smh.a01IOStreamDemo1;

import java.io.FileOutputStream;
import java.io.IOException;

public class IOStreamDemo3 {
    public static void main(String[] args) throws IOException {

        //第二个参数是续写开关,默认为false,表示覆盖
        FileOutputStream fos = new FileOutputStream("day26-code\\file\\a.txt", true);
        String s = "smhhaoshuai";
        byte[] bytes = s.getBytes();

        fos.write(bytes);
        //换行符
        //window: \r回车,到该行开头   \n到下一行
        //linux:    \n
        //Mac:      \r
        //java会帮我们补全,但是我们还是写全吧
        fos.write('\r');
        fos.write('\n');
        fos.write('6');
        fos.close();

    }
}
